<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" th:href="@{css/bootstrap.min.css}">
    <script th:src="@{js/jquery-1.10.2.min.js}"></script>
    <script th:src="@{js/bootstrap.min.js}"></script>
    <script th:src="@{js/echarts.min.js}"></script>
    <title>花仙子 商城首页</title>
</head>

<body>
<div class="row clearfix">
    <div class="col-md-12 column">
        <nav class="navbar navbar-default" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1"><span class="sr-only">Toggle
                            navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span
                        class="icon-bar"></span></button>
                <a class="navbar-brand" th:href="@{/}">Brand</a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li class="active">
                        <a href="/admin">功能1</a>
                    </li>
                </ul>
                <form class="navbar-form navbar-left" role="search">
                    <div class="form-group">
                        <input type="text" class="form-control"/>
                    </div>
                    <button type="submit" class="btn btn-default">查询</button>
                </form>
                <ul class="nav navbar-nav navbar-right">
                    <!-- 若没有经过登录环节，则显示。。 -->
                    <li th:unless="${session.customer}">
                        <a href="/login">登录</a>
                    </li>
                    <li th:unless="${session.customer}">
                        <a href="/reg">注册</a>
                    </li>
                    <!--若登录成功，则显示 欢迎。。。 -->
                    <li th:if="${session.customer}">
                        <a href="#">欢迎您:
                            <span th:text="${session.customer.realname}"></span>
                        </a>
                    </li>
                    <li th:if="${session.customer}">
                        <a href="/logout">退出</a>
                    </li>
                    <!--若没有经过登录环节，则购物车及个人中心不能正常操作，会跳转至登录页。。。 -->
                    <li>
                        <a href="/cart" th:if="${session.customer}"> <span class="badge pull-right text-success"
                                                                           style="background-color: green;">4</span>我的购物车</a>
                        <a href="/login" th:unless="${session.customer}"> <span class="badge pull-right text-success"
                                                                                style="background-color: green;">4</span>我的购物车</a>
                    </li>
                    <li>
                        <a href="/info" th:if="${session.customer}">个人中心</a>
                        <a href="/login" th:unless="${session.customer}">个人中心</a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>
</div>
</body>
</html>

